<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script src="../../js/echarts.min.js" charset="utf-8"></script>
</head>
<style>
    .div-1 {
        width: 100%;
        height: 360px;
    }
    .div-1-1 {
        width: 50%;
        height: 100%;
        float: left;
    }
    .div-1-2 {
        width: 50%;
        height: 100%;
        float: left;
    }
</style>
<body>
    <div class="div-1">
        <div class="div-1-1" id="pie">
            
        </div>
        <div class="div-1-2" id="chart">

        </div>
    </div>
    
    <script>
        var chartDom = document.getElementById('pie');
        var myChart = echarts.init(chartDom);
        var option;
        $.ajax({
            url: "http://localhost:8080/admin/vaccine/vaccine/queryVaccineVarietyEchartPie",
            type: "post",
            data: {},
            success: function (result) {
                var arr = result.data.pie;
                option = {
                    legend: {
                        top: 'bottom'
                    },
                    toolbox: {
                        show: true,
                        feature: {
                        mark: { show: true },
                        dataView: { show: true, readOnly: false },
                        restore: { show: true },
                        saveAsImage: { show: true }
                        }
                    },
                    series: [
                        {
                        name: 'Nightingale Chart',
                        type: 'pie',
                        radius: [25, 125],
                        center: ['50%', '50%'],
                        roseType: 'area',
                        itemStyle: {
                            borderRadius: 8
                        },
                        data: arr
                        }
                    ]
                    };

                    myChart.setOption(option);
                }
            })
    </script>
    <script>
        var chartDom2 = document.getElementById('chart');
        var myChart2 = echarts.init(chartDom2);
        var option2;
        $.ajax({
            url: "http://localhost:8080/admin/vaccine/status/queryStatusStatusEchartPie",
            type: "post",
            data: {},
            success: function (result) {
                var arr = result.data.pie2;
                option2 = {
                    legend: {
                        top: 'bottom'
                    },
                    toolbox: {
                        show: true,
                        feature: {
                        mark: { show: true },
                        dataView: { show: true, readOnly: false },
                        restore: { show: true },
                        saveAsImage: { show: true }
                        }
                    },
                    series: [
                        {
                        name: 'Nightingale Chart',
                        type: 'pie',
                        radius: [25, 125],
                        center: ['50%', '50%'],
                        roseType: 'area',
                        itemStyle: {
                            borderRadius: 8
                        },
                        data: arr
                        }
                    ]
                    };
                    myChart2.setOption(option2);
                }
            })
    </script>
</body>

</html>